package br.facet.dao;

import org.hibernate.Session;
import org.hibernate.Transaction;

import br.facet.pojo.SaldoLoja;
import br.facet.utils.HibernateUtils;

public class SaldoLojaDAO {

	public void salvar(SaldoLoja saldo) throws Exception {
		Session sessao = null;
		Transaction tx = null;

		try {
			sessao = HibernateUtils.getSession();
			tx = sessao.beginTransaction();
			sessao.save(saldo);
			tx.commit();

		} catch (Exception e) {
			tx.rollback();
			e.printStackTrace();
		} finally {
			if (sessao != null) {
				try {
					sessao.close();
				} catch (Exception e2) {
					e2.printStackTrace();
				}
			}
		}

	}
}
